<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .test{
      display: flex;
    }
    .test>div:nth-child(1){
      flex: 0 0 50px;
      background-color: red;
    }
    .test>div:nth-child(2){
      flex: 1 1 auto;
      background-color: green;

    }
    .test>div:nth-child(3){
      flex: 0 0 50px;
      background-color: blue;

    }

    @media screen and (min-width: 300px) and (max-width: 600px){
      .test>div:nth-child(2){
        background-color: rgb(164, 15, 223);

      }
    }

    @media screen and (min-width: 601px) and (max-width: 900px){
      .test>div:nth-child(2){
        background-color: rgb(11, 182, 250);

      }
    }

  </style>

</head>
<body>
  <div class="test">
    <div>1</div>
    <div>2</div>
    <div>3</div>
  </div>
</body>
</html>
